﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OpenPhotoAlbum.Controls.PhotoProcessors
{
	public static class ProcessorFactory
	{
		public static IPhotoProcessor CreateProcessor(string name)
		{
			IPhotoProcessor processor = null;

			switch (name)
			{
				case VisualEffects.NegativeImage:
					processor = new NegativeImage();
					break;
				case VisualEffects.Convax:
					processor = new Convax();
					break;
				case VisualEffects.Glass:
					processor = new Glass();
					break;
				case VisualEffects.Mosaic:
					processor = new Mosaic();
					break;
				case VisualEffects.OilPainting:
					processor = new OilPainting();
					break;
				case VisualEffects.EdgeDetection:
					processor = new EdgeDetection();
					break;
				case VisualEffects.Emboss:
					processor = new Emboss();
					break;
				case VisualEffects.Sketch:
					processor = new Sketch();
					break;
				case VisualEffects.SketchHeavy:
					processor = new SketchHeavy();
					break;
				case VisualEffects.OldPhoto:
					processor = new OldPhoto();
					break;
				case VisualEffects.RoundedCorners:
					processor = new RoundedCorners();
					break;
				default: throw new NotImplementedException(name + " is not implemented.");
			}

			return processor;
		}
	}
}
